package org.example.design.singleton;

/**
 * @Classname Singleton1
 * @Description 双重懒汉加载pricvate
 * @Date 2021/4/12 3:53 下午
 * @Created by xiangjd
 */
public class Singleton1 {

    private static volatile Singleton1  singleton1;

    private Singleton1(){}



    public  static Singleton1 getInstance(){
        if(singleton1 == null){
            synchronized (Singleton1.class){
                if(singleton1 == null){
                    singleton1 = new Singleton1();
                }
            }
        }
        return  singleton1;
    }

}